package com.online.servlet.admin;

import com.online.service.user.Impl.ShopServiceImpl;
import com.online.service.user.ShopService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;

@WebServlet("/disagreeShop")
public class disagreeShopServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
        String name = req.getParameter("name");
        ShopService shopService = new ShopServiceImpl();
        System.out.println("disagree :"+ name);
        try {
            shopService.overrule(name);
            req.getRequestDispatcher("/reload").forward(req,resp);
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (ServletException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}